home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- UGBDraw
-
- Public domain, by Zig Zichterman.
-
- Utility functions for drawing in color. All these functions assume
- color quickdraw.
-
- This class implements 3D drawing according to the guidelines
- suggested in _develop_ 15. Some of the drawing code is taken from
- the public domain source accompanying _develop_ 15.
-
- 07/31/94 zz add ColorQDIsPresent()
- 07/28/94 zz add offscreen drawing stuff
- **************************************************************************/
- #pragma once
-
- #include <QDOffscreen.h>
-
- const short UGBDraw_greyF = 0xFFFF; // 65535
- const short UGBDraw_greyE = 0xEEEE; // 61166
- const short UGBDraw_greyD = 0xDDDD; // 56797
- const short UGBDraw_greyC = 0xCCCC; // 52428
- const short UGBDraw_greyB = 0xBBBB; // 48059
- const short UGBDraw_greyA = 0xAAAA; // 43690
- const short UGBDraw_grey9 = 0x9999; // 39321
- const short UGBDraw_grey8 = 0x8888; // 34952
- const short UGBDraw_grey7 = 0x7777; // 30583
- const short UGBDraw_grey6 = 0x6666; // 26214
- const short UGBDraw_grey5 = 0x5555; // 21845
- const short UGBDraw_grey4 = 0x4444; // 17476
- const short UGBDraw_grey3 = 0x3333; // 13107
- const short UGBDraw_grey2 = 0x2222; // 8738
- const short UGBDraw_grey1 = 0x1111; // 4369
- const short UGBDraw_grey0 = 0x0000; // 0
-
- const short UGBDraw_white = UGBDraw_greyF;
- const short UGBDraw_black = UGBDraw_grey0;
- const short UGBDraw_background = UGBDraw_greyD;
- const short UGBDraw_hiliteBackground = UGBDraw_grey8;
-
- const short UGBDraw_3DLight = UGBDraw_greyF;
- const short UGBDraw_3DDark = UGBDraw_greyB;
-
- const short UGBDraw_DimText = UGBDraw_grey8; // was A
-
- // ### accent colors not implemented yet
- const short UGBDraw_AccentLight = UGBDraw_greyC;
- const short UGBDraw_AccentDark = UGBDraw_grey7;
-
-
- /**************************************************************************
- class UGBDraw
- **************************************************************************/
- class UGBDraw {
- public :
- static void PenNormal(void);
- static void PenReallyNormal(void);
- static void Background(void) { BackGrey(UGBDraw_background); }
- static void PenFrameInactive(void) { ForeGrey(UGBDraw_DimText); }
- static void PenFrameActive(void) { ForeGrey(UGBDraw_black); }
-
- static void ForeGrey(unsigned short inGrey);
- static void BackGrey(unsigned short inGrey);
-
- struct Offscreen {
- CGrafPtr savePort;
- GDHandle saveDevice;
- Rect gbounds; // global bounds
- Rect lbounds; // bounds local to the *screen* port
- GWorldPtr gworld;
- };
- static void OffscreenPre(Offscreen &outOffscreen);
- static void OffscreenPost(Offscreen &ioOffscreen);
-
- static Boolean ColorQDIsPresent(void);
- };
-
-
-